package com.qf.feign;

import com.qf.pojo.User;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * feign兜底类：如果被调用方抛异常，为了用户体验，可以直接放回这里兜底方法的结果
 * 而不是直接返回异常信息给用户
 * @author fy
 * @version V1.0
 * @Project workspace
 * @Package com.qf.feign
 * @Description:
 * @Date 2022/7/7 20:10
 */
@Component
@RequestMapping("/searchFallback")
public class SearchFeignFallback implements SearchFeign {
    @Override
    public String test1() {
        return "feign调用出了问题，稍后再试！";
    }

    @Override
    public User findUserById(Integer id) {
        return new User();
    }
}
